<?php /* Smarty version 2.6.26, created on 2011-02-16 17:21:41
         compiled from admin/submodules/documents.tab.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'regex_replace', 'admin/submodules/documents.tab.html', 23, false),array('modifier', 'lower', 'admin/submodules/documents.tab.html', 23, false),array('modifier', 'date_format', 'admin/submodules/documents.tab.html', 25, false),array('function', 'math', 'admin/submodules/documents.tab.html', 41, false),array('function', 'mailto', 'admin/submodules/documents.tab.html', 94, false),array('function', 'html_select_date', 'admin/submodules/documents.tab.html', 103, false),)), $this); ?>

<div class="tabs">
    <ul>
	<li><a href="#doc-regular">Основные</a></li>
	<li><a href="#doc-ttk">Расчётные документы</a></li>
    </ul>

<!-- Под-ВКЛАДКА Документы-Общие -->
    <div id="doc-regular">
	<table id="document" class="ui-widget" cellspacing="0" rules="all" style="border: solid 1px #000000;">
	    <thead class="ui-widget-header">
		<tr>
		    <th>Дата</th>
		    <th>Номер документа</th>
		    <th>Название документа</th>
		    <th>Файл</th>
		    <th>&nbsp;</th>
		</tr>
	    </thead>
	    <tbody class="ui-widget-content">
	    <?php $_from = $this->_tpl_vars['docs_regular']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['doc']):
?>
	    <?php $this->assign('mime', ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['doc']['filename'])) ? $this->_run_mod_handler('regex_replace', true, $_tmp, '/.+\.(.+)$/', '$1') : smarty_modifier_regex_replace($_tmp, '/.+\.(.+)$/', '$1')))) ? $this->_run_mod_handler('lower', true, $_tmp) : smarty_modifier_lower($_tmp))); ?>
		<tr class="data-row">
		    <td><span style="display: none;"><?php echo $this->_tpl_vars['doc']['id']; ?>
</span><?php echo ((is_array($_tmp=$this->_tpl_vars['doc']['document_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y') : smarty_modifier_date_format($_tmp, '%d.%m.%Y')); ?>
</td>
		    <td><?php echo $this->_tpl_vars['doc']['document_num']; ?>
</td>
		    <td><?php echo $this->_tpl_vars['doc']['document_name']; ?>
</td>
		    <td>
			<a href="/cgi-bin/dl.cgi?id=<?php echo $this->_tpl_vars['doc']['id']; ?>
">
			<?php if ($this->_tpl_vars['mime'] == 'jpg' || $this->_tpl_vars['mime'] == 'gif' || $this->_tpl_vars['mime'] == 'png' || $this->_tpl_vars['mime'] == 'bmp'): ?>
			    <img src="images/icons/mimetypes/image.png" border="0"/>
			<?php elseif ($this->_tpl_vars['mime'] == 'pdf'): ?>
			    <img src="images/icons/mimetypes/pdf-document.png" border="0"/>
			<?php elseif ($this->_tpl_vars['mime'] == 'txt'): ?>
			    <img src="images/icons/mimetypes/txt.png" border="0"/>
			<?php else: ?>
			    <img src="images/icons/mimetypes/unknown.png" border="0"/>
			<?php endif; ?>
			<?php echo $this->_tpl_vars['doc']['filename']; ?>

			</a>
			<i>(<?php echo smarty_function_math(array('equation' => 'x/1024','x' => $this->_tpl_vars['doc']['size'],'format' => '%0.2f'), $this);?>
 КБ)</i>
		    </td>
		    <td align="center"><a href="?action=document.delete&id=<?php echo $this->_tpl_vars['doc']['id']; ?>
"><img src="images/icons/delete_16.png" border="0" title="Удалить"/></a></td>
		</tr>
	    <?php endforeach; else: ?>
		<tr><td align="center" colspan="5"><i>документы не загружены</i></td></tr>
	    <?php endif; unset($_from); ?>
	    </tbody>
	</table>
	<br/>
	<input type="button" class="button" id="document-add" value="Добавить документы"/>
    </div>

<!-- Под-ВКЛАДКА Документы-ТТК -->
    <div id="doc-ttk">
	<table class="ui-widget " cellspacing="0" rules="all" style="border: solid 1px #000000;">
	    <thead class="ui-widget-header">
		<tr>
		    <th>Дата</th>
		    <th>Название документа</th>
		    <th>Файл</th>
		    <th>&nbsp;</th>
		</tr>
	    </thead>
	    <tbody class="ui-widget-content">
	    <?php $_from = $this->_tpl_vars['docs_ttk']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['doc']):
?>
	    <?php $this->assign('mime', ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['doc']['filename'])) ? $this->_run_mod_handler('regex_replace', true, $_tmp, '/.+\.(.+)$/', '$1') : smarty_modifier_regex_replace($_tmp, '/.+\.(.+)$/', '$1')))) ? $this->_run_mod_handler('lower', true, $_tmp) : smarty_modifier_lower($_tmp))); ?>
		<tr class="data-row">
		    <td><?php echo ((is_array($_tmp=$this->_tpl_vars['doc']['document_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y') : smarty_modifier_date_format($_tmp, '%d.%m.%Y')); ?>
</td>
		    <td><?php echo $this->_tpl_vars['doc']['document_name']; ?>
</td>
		    <td>
			<a href="/cgi-bin/dl.cgi?id=<?php echo $this->_tpl_vars['doc']['id']; ?>
">
			    <?php if ($this->_tpl_vars['mime'] == 'jpg' || $this->_tpl_vars['mime'] == 'gif' || $this->_tpl_vars['mime'] == 'png' || $this->_tpl_vars['mime'] == 'bmp'): ?>
			<img src="images/icons/mimetypes/image.png" border="0"/>
			    <?php elseif ($this->_tpl_vars['mime'] == 'pdf'): ?>
			<img src="images/icons/mimetypes/pdf-document.png" border="0"/>
			    <?php elseif ($this->_tpl_vars['mime'] == 'txt'): ?>
			<img src="images/icons/mimetypes/txt.png" border="0"/>
			    <?php else: ?>
			<img src="images/icons/mimetypes/unknown.png" border="0"/>
			    <?php endif; ?>
			<?php echo $this->_tpl_vars['doc']['filename']; ?>

			</a>
			<i>(<?php echo smarty_function_math(array('equation' => 'x/1024','x' => $this->_tpl_vars['doc']['size'],'format' => '%0.2f'), $this);?>
 КБ)</i>
		    </td>
		    <td align="center"><a href="?action=document.delete&id=<?php echo $this->_tpl_vars['doc']['id']; ?>
"><img src="images/icons/delete_16.png" border="0" title="Удалить"/></a></td>
		</tr>
	    <?php endforeach; else: ?>
		<tr><td align="center" colspan="5"><i>документы не загружены</i></td></tr>
	    <?php endif; unset($_from); ?>
	    </tbody>
	</table>
	<br/>
	<small><i>* Примечание:</i><br/>Для того чтобы загрузить документы в этот раздел, Вам необходимо отправить их на адрес <?php echo smarty_function_mailto(array('address' => "region-ttk@yandex.ru"), $this);?>
<br/>Документы будут отсортированы и опубликованы автоматически в течение одного часа.</small>

<!-- Форма выбора периода для оторбражения документов -->
	<br/><br/>
	<div class="ui-widget <?php if ($this->_tpl_vars['by_period'] == 1): ?>ui-state-default<?php else: ?>ui-state-disabled<?php endif; ?> ui-corner-all div-set-period">
	    <form method="get" action="#invoice">
		<input type="hidden" name="id" value="<?php echo $this->_tpl_vars['customer']['id']; ?>
"/>
		<center>
		    <input type="checkbox" class="set-period" <?php if ($this->_tpl_vars['by_period'] == 1): ?>checked<?php endif; ?>/>
		    Отображать документы <?php echo smarty_function_html_select_date(array('display_days' => false,'start_year' => 2009,'prefix' => 'docStart_'), $this);?>
 по <?php echo smarty_function_html_select_date(array('display_days' => false,'prefix' => 'docEnd_'), $this);?>
&nbsp;<input type="submit" value="&raquo;"/>
		</center>
	    </form>
	</div>
    </div>
</div>